/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cadi.menu;

import com.cadi.aux.Window;
import com.cadi.levelsManager.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;

/**
 *
 * @author Luis Eduardo Garay
 */
public class MainMenu extends Window {
    
    private final JLabel title, instruction, exit;
    private final JButton seleccionarDinero;
    private final JButton empate;
    private final JButton cuentas;
    private final JButton compras;
    private final JButton identificaBilletes;
    private final JButton mostrarBilletes;
    private final JButton compara;
    
    public MainMenu(){
        super();
        instruction = new JLabel(new ImageIcon(getClass().getResource("/resources/globoMainMenu.png")));
        instruction.setBounds(150, 300, 200, 162);
        this.container.add(instruction, JLayeredPane.PALETTE_LAYER);
        title = new JLabel(new ImageIcon(getClass().getResource("/resources/banner.png")));
        title.setBounds(10, 10, 650, 139);
        this.container.add(title);
        seleccionarDinero = new JButton("Seleccionar Dinero");
        seleccionarDinero.setFont(styleText);
        seleccionarDinero.setBounds(350,250,200,100);
        seleccionarDinero.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                LevelsCoinSelector levels = new LevelsCoinSelector();
                window.setVisible(false);
            }
        });
        this.container.add(seleccionarDinero, JLayeredPane.PALETTE_LAYER);
        empate = new JButton("Empate");
        empate.setFont(styleText);
        empate.setBounds(625, 250, 200, 100);
        empate.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                LevelsCurrencyMatch levels = new LevelsCurrencyMatch();
                window.setVisible(false);
            }
        });
        this.container.add(empate, JLayeredPane.PALETTE_LAYER);
        cuentas = new JButton("Cuentas");
        cuentas.setFont(styleText);
        cuentas.setBounds(900, 250, 200, 100);
        cuentas.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                LevelsCount levels = new LevelsCount();
                window.setVisible(false);
            }
        });
        this.container.add(cuentas, JLayeredPane.PALETTE_LAYER);
        compras = new JButton("Compras");
        compras.setFont(styleText);
        compras.setBounds(625, 400, 200, 100);
        compras.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                LevelSuper LevelOne = new LevelSuper();
                window.setVisible(false);
            }
        });
        this.container.add(compras, JLayeredPane.PALETTE_LAYER);
        identificaBilletes = new JButton("Identifica billetes");
        identificaBilletes.setFont(styleText);
        identificaBilletes.setBounds(900, 400, 200, 100);
        identificaBilletes.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                LevelsIdentifyBill levels = new LevelsIdentifyBill();
                window.setVisible(false);
            }
        });
        this.container.add(identificaBilletes, JLayeredPane.PALETTE_LAYER);
        mostrarBilletes = new JButton("Mostrar billetes");
        mostrarBilletes.setFont(styleText);
        mostrarBilletes.setBounds(350,400,200,100);
        mostrarBilletes.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                LevelsShowBill one = new LevelsShowBill();
                window.setVisible(false);
            }
        });
        this.container.add(mostrarBilletes, JLayeredPane.PALETTE_LAYER);
        compara = new JButton("Compara");
        compara.setFont(styleText);
        compara.setBounds(625,550,200,100);
        compara.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                LevelsCompare one = new LevelsCompare();
                window.setVisible(false);
            }
        });
        this.container.add(compara, JLayeredPane.PALETTE_LAYER);
        toMenu.setVisible(false);
        exit = new JLabel(new ImageIcon(getClass().getResource("/resources/salir.png")));
        exit.setBounds(1150, 600, 100, 100);
        exit.addMouseListener(new MouseAdapter() {
        @Override
            public void mouseClicked(MouseEvent evt){
               System.exit(0);
                
            }});
        container.add(exit, JLayeredPane.PALETTE_LAYER);
        window.setVisible(true);
        window.repaint();
        voice = java.applet.Applet.newAudioClip(getClass().getResource("/resources/mainMenu.wav"));
        voice.play();
    }    
}
